<div class="seasons view">
	<h2><?= $season['Season']['season_name'] . ' Season'; ?></h2>
	<span id="dates">
		<?= 'From ' . date('F j, Y', strtotime($season['Season']['start_date'])) . ' &nbsp;to&nbsp; ' . date('F j, Y', strtotime($season['Season']['end_date'])); ?>
	</span>
	<fieldset>
		<legend>Description</legend>
		<?= $season['Season']['description']; ?>
	</fieldset>
	
	<div id="events">
		<h2>Season Events:</h2>
		<ul>
		<?php
			$flag = true;
			foreach($events as $event) {
			$flag = false;
		?>
			<li>
				<?= $html->link(__($event['Event']['title'], true), array('controller' => 'events', 'action' => 'main', $event['Event']['id']),null, null, false); ?>
			</li>
		<?php
			}
			if ($flag) {
				echo '<li>There is no events in this season.</li>';
			}
		?>
		</ul>
	</div>
</div>
<div class="actions">
	<ul>
		<?php
			if ($accessArray['CreateSeason']) {
		?>
			<li><?php echo $html->link(__('Edit Season', true), array('action' => 'edit', $season['Season']['id'])); ?> </li>
			<li><?php echo $html->link(__('Delete Season', true), array('action' => 'delete', $season['Season']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $season['Season']['id'])); ?> </li>
			<li><?php echo $html->link(__('New Season', true), array('action' => 'add')); ?> </li>
		<?php
			}
		?>
		
		<?php
			$today = strtotime(date("Y-m-d"));
			$start_time = strtotime($season['Season']['start_date']);
			$end_time = strtotime($season['Season']['end_date']);
			
			if ($today >= $start_time && $today <= $end_time) {
				if ($accessArray['CreateEvent']) {
		?>
				<li><?= $html->link(__('Create new Event', true), array('controller' => 'events', 'action' => 'add'), null, null, false); ?></li>
		<?php
				}
			}
		?>
		
		<li><?php echo $html->link(__('List Seasons', true), array('action' => 'index')); ?> </li>
		
	</ul>
</div>
